package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzy
 * @since 2022-06-18 22:40:07
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@TableName("spider_auth_resource")
@ApiModel(value = "SpiderAuthResourceEntity对象", description = "")
public class SpiderAuthResourceEntity extends Model<SpiderAuthResourceEntity> {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty("资源父级id")
    @TableField("resource_parent_id")
    private Long resourceParentId;

    @ApiModelProperty("资源名称")
    @TableField("resource_name")
    private String resourceName;

    @ApiModelProperty("资源路径")
    @TableField("resource_path")
    private String resourcePath;

    @ApiModelProperty("资源图标")
    @TableField("resource_icon")
    private String resourceIcon;

    @ApiModelProperty("资源排序值")
    @TableField("resource_order")
    private Integer resourceOrder;

    @ApiModelProperty("资源类型，1：菜单；2：按钮；3：api接口")
    @TableField("resource_type")
    private Integer resourceType;

    @ApiModelProperty("资源状态，1：被禁用；2：正常使用；3：被删除")
    @TableField("resource_status")
    private Integer resourceStatus;

    @ApiModelProperty("备注")
    @TableField("resource_remark")
    private String resourceRemark;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
